#include "head.h"
int initpool(ShareValue*sv,int num){
    sv->exit_flag=0;
    sv->q.size=0;
    sv->q.head=NULL;
    sv->q.tail=NULL;
    sv->num=num;    
    pthread_mutex_init(&sv->lock_mutex,NULL);
    pthread_cond_init(&sv->cond,NULL);
   sv->plist=(pthread_t*)malloc(num*sizeof(pthread_t));
    for(int i=0;i<4;i++){
        pthread_t pid;
        pthread_create(&pid,NULL,func,sv);
        sv->plist[i]=pid;
    }
    return 0;
}
